package com.hxx.hospitalregistered.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResponseOBJ<T> {

    /**
     * 成功状态码
     */
    public final static Integer SUCCESS = 200;
    /**
     * 失败状态码
     */
    public final static Integer ERROR = -1;

    /**
     * layui统一返回格式
     */
    private Integer code;
    public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public long getCount() {
		return count;
	}

	public void setCount(long count) {
		this.count = count;
	}

	public static Integer getSuccess() {
		return SUCCESS;
	}

	public static Integer getError() {
		return ERROR;
	}

	private String msg;
    private T data;
    private long count;

    public static ResponseOBJ getInstance() {
        return new ResponseOBJ<>();
    }
}
